package com.cloudkinto.service.product;

import com.cloudkinto.entity.ProductOutDo;
import com.baomidou.mybatisplus.extension.service.IService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.service.product.vo.ProductOutExportReq;
import com.cloudkinto.service.product.vo.rack.SendRes;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author hua
 * @since 2022-09-21
 */
public interface ProductOutService extends IService<ProductOutDo> {

    SingleResult addInit(Long userId, Long companyId);

    Object add(Object req, Long userId);

    SingleResult updateInit(Long id);

    Object update(Object updateVo, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<Object> getList(Map<String, String> map);

    PageResult getListPage(Map<String, String> map);

    double getRate(String type);

    List<String> importOrderOut(MultipartFile file, Long shopId, Long companyId, Long useId) throws IOException;

    void dealWithStock(Long stockId, Long productId, Long storageId, Long shopId, Long companyId, Long useId, int count,
                       String outSystemOrderNo, String outOrderNo, String  platform, String orderType, boolean omsFlag);

    PageResult getOutDetail(Long shopId, String timeType, String initialDate, String skuEq, String keyword, int current, int pageSize);

    PageResult getOutDetailBySku(Long shopId, String timeType, List<String> initialDateList, String keyword, int current, int pageSize);

    void export(ProductOutExportReq req, HttpServletResponse response) throws IOException;

    void exportOverView(ProductOutExportReq req, HttpServletResponse response) throws IOException;

    void exportStockLog(ProductOutExportReq req, HttpServletResponse response) throws IOException;

    SendRes dealStockAfterSendOut(Long outputId, String orderNo, String platform, String orderType, int quantity, Long productId, Long storageId, Long shopId, Long pickUpId, Long companyId, Long userId);

    void matchPlatformTime();

    void matchPlatformTimeUtils();
}
